<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    .flex{
        display: flex;
    }
    .box{
        width: 50%;
        border: 1px solid red;
        background-origin: padding-box;
        display: inline-block;
        width: 50%;
        padding: 5px;
    }
</style>
<body>
    <div class="container flex">
        <div class="box">第1个盒子</div><div class="box">第2个盒子</div>
    </div>
   

</body>
</html>